﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="EigenPagina.aspx.cs" Inherits="Quaack.EigenPagina" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="FeaturedContent" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
   
   
     
   
        
   

      
       
    <br />
    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataKeyNames="profileid" DataSourceID="gebuikers" OnRowCommand="GridView2_RowCommand">
        <Columns>
            <asp:BoundField DataField="profileid" HeaderText="profileid" InsertVisible="False" ReadOnly="True" SortExpression="profileid" >
              <ItemStyle CssClass="verberg" />
                 </asp:BoundField>
            <asp:BoundField DataField="username" HeaderText="username" SortExpression="username" />
              <asp:ButtonField CommandName= "GaNaarGebruiker" Text="Ganaargebruiker" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="gebuikers" runat="server" ConnectionString="<%$ ConnectionStrings:Quaack %>" SelectCommand="SELECT DISTINCT [profileid], [username] FROM [profile]"></asp:SqlDataSource>
<br />

    <p>
        
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="messages" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" AllowPaging="True">
            <Columns>
               
                 <asp:ButtonField />
               
                 <asp:ImageField AccessibleHeaderText="Avatar" AlternateText="Avatar" DataImageUrlField="avatarlocation" HeaderText="Avatar" NullDisplayText="je hebt nog geen avatar geupload." NullImageUrl="~/Images/default.jpg">
                     <ControlStyle Width="75px" />
                </asp:ImageField>


                <asp:BoundField DataField="username" HeaderText="gebruiker" SortExpression="username" />
                <asp:BoundField DataField="message" HeaderText="bericht" SortExpression="message" />
                <asp:BoundField DataField="messdatetime" HeaderText="datum" SortExpression="messdatetime"/>

                <asp:BoundField DataField="sender" SortExpression="sender" HeaderText="pblocked" >
                 <ItemStyle CssClass="verberg" />
                 </asp:BoundField>
               
                 <asp:BoundField DataField="parentmessid" SortExpression="parentmessid" >
                  <ItemStyle CssClass="verberg" />
                 </asp:BoundField>

                  <asp:BoundField DataField="messid" SortExpression="messid" >
                  <ItemStyle CssClass="verberg" />
                 </asp:BoundField>

                 <asp:TemplateField SortExpression="permblocked">
                     <EditItemTemplate>
                         <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("permblocked") %>' />
                     </EditItemTemplate>
                     <ItemTemplate>
                         <asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("permblocked") %>' Enabled='<%# Bind("permblocked") %>' />
                     </ItemTemplate>
                 </asp:TemplateField>

                 <asp:ButtonField CommandName= "GaNaarGebruiker" Text="Ganaargebruiker" />
                 <asp:ButtonField CommandName= "Reageer" Text="Reageer" />
                 <asp:ButtonField CommandName="Blokkeer" Text="Blokkeer" />
                 <asp:ButtonField CommandName="Verwijder" Text="Verwijder" />
                            

            </Columns>
        </asp:GridView>
        <asp:SqlDataSource ID="messages" runat="server" ConnectionString="<%$ ConnectionStrings:Quaack %>" SelectCommand="SELECT profile.avatarlocation, profile.username, message.message, message.messdatetime, message.parentmessid, message.sender, profile_1.permblocked, message.messid FROM message INNER JOIN profile ON message.sender = profile.profileid INNER JOIN profile AS profile_1 ON message.sender = profile_1.profileid WHERE (message.sender = @profileid) AND (message.removed = 0) OR (message.sender = profile.profileid) AND (message.removed = 0) AND (message.parentmessid = @profileid) ORDER BY message.messdatetime, message.parentmessid">
            <SelectParameters>
                <asp:SessionParameter DefaultValue="0" Name="profileid" SessionField="userID" />
            </SelectParameters>
        </asp:SqlDataSource>
    </p>
    <p>
        &nbsp;</p>

    
</asp:Content>
